﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Asomy.Model.Brushes
{
    class StandardBrush : Brush
    {
        private int m_size = 15;
        private int m_sizeMax = 50;
        private int m_sizeMin = 1;
        private string m_name = "standard";
        private int m_id = 0;

        public StandardBrush(int a_id)
        {
            m_id = a_id;
        }

        public int Size
        {
            get { return m_size; }
            set 
            {
                if (value < m_sizeMin)
                {
                    m_size = m_sizeMin;
                }
                else if (value > m_sizeMax)
                {
                    m_size = m_sizeMax;
                }
                else
                {
                    m_size = value;
                }
            }
        }

        public List<int[]> Draw(int a_mouseX, int a_mouseY)
        {
            List<int[]> f_paintpositions = new List<int[]>();            

            for (int i = a_mouseX - Size/2; i < a_mouseX + (Size+0.5f)/2; i++)
            {
                for (int j = a_mouseY - Size/2; j < a_mouseY + (Size+0.5f)/2; j++)
                {
                    f_paintpositions.Add(new int[] { i, j });                        
                }                
            }

            return f_paintpositions;
        }

        public string GetName()
        {
            return m_name;
        }

        public int GetID()
        {
            return m_id;
        }

        public void ChangeSize(int a_size)
        {
            Size = a_size;
        }

        public int GetMaxSize()
        {
            return m_sizeMax;
        }

        public int GetMinSize()
        {
            return m_sizeMin;
        }

        public int GetSize()
        {
            return Size;
        }        
    }
}
